package com.blazingredfireball.rouleurlog.ria.business
{
	import mx.rpc.IResponder;
	import com.adobe.cairngorm.business.ServiceLocator;
	import com.blazingredfireball.rouleurlog.ria.vo.RouteVO;
	
	public class RouteDelegate
	{
		private var responder : IResponder;
		private var service : Object;
		
		public function RouteDelegate(responder : IResponder)
		{
			this.service = ServiceLocator.getInstance().getService( "routeService" );
			this.responder = responder;
		}
		
		public function getRoutes(user_id : int) : void
		{
			var call : Object = service.getRoutes();
			call.resultHandler = responder.result;
			call.faultHandler = responder.fault;	
		}
		
		public function createRoute(route : Object) : void
		{			
			var call : Object = service.createRoute(route);
			call.resultHandler = responder.result;
			call.faultHandler = responder.fault;	
		}
		
		public function deleteRoute(id : int) : void
		{			
			var call : Object = service.deleteRoute(id);
			call.resultHandler = responder.result;
			call.faultHandler = responder.fault;	
		}
		
		public function updateRoute(id : int, route : Object) : void
		{			
			var call : Object = service.updateRoute(id, route);
			call.resultHandler = responder.result;
			call.faultHandler = responder.fault;	
		}
		
	}
}